# $Id: PKGBUILD 280288 2016-11-10 18:13:29Z arojas $
# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Andrea Scarpino <andrea@archlinux.org>

pkgname=audiocd-kio4
pkgver=16.08.3
pkgrel=2
pkgdesc="Kioslave for accessing audio CDs"
url='https://www.kde.org/applications/multimedia/'
arch=(i686 x86_64)
license=(GPL LGPL FDL)
depends=(libkcddb4 libkcompactdisc4 lame)
makedepends=(cmake automoc4)
replaces=(kdemultimedia-kioslave kdemultimedia-audiocd-kio)
conflicts=(kdemultimedia-kioslave kdemultimedia-audiocd-kio)
source=("http://download.kde.org/stable/applications/${pkgver}/src/audiocd-kio-${pkgver}.tar.xz")
sha256sums=('78988ef13f4228d94923d50dc54129a91d034ffcf014029dbc39bdb0cdedf8b4')

prepare() {
  mkdir -p build
}

build() {
  cd build
  cmake ../audiocd-kio-$pkgver \
    -DCMAKE_BUILD_TYPE=Release \
    -DKDE4_BUILD_TESTS=OFF \
    -DCMAKE_INSTALL_PREFIX=/usr
  make
}

package() {
  cd build
  make DESTDIR="$pkgdir" install

# Fix conflicts with audiocd-kio
  rm -r "$pkgdir"/usr/{include,lib/libaudiocdplugins.so,share/config.kcfg}
}
